﻿#ifndef __GameHall__GNS_YJFPopWnd__
#define __GameHall__GNS_YJFPopWnd__

#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"
#include "GNS_CursorTextField.h"
//#include "GNS_TipsWnd.h"

USING_NS_CC;
using namespace cocostudio::timeline;
using namespace ui;
using namespace std;

class GNS_YJFLayer : public Layer
{
public:
	GNS_YJFLayer();
	~GNS_YJFLayer();
	static GNS_YJFLayer* createLayer(std::string CsbName);
	virtual Node* Loadcsb(std::string csbName);	  //º”‘ÿcsbŒƒº˛
	virtual bool init();
	CREATE_FUNC(GNS_YJFLayer);
//	void BtnCallBack(Ref *pSender, ui::Widget::TouchEventType type);
	virtual void setSwallow(bool isShow = true);
	void ShowMyTips(string str = "", bool isShow = true);
	void TextFileTouch(cocos2d::Ref *pSender, ui::Widget::TouchEventType type);
	
	Button* crateBtnWithFile(string fileName, int tag, Vec2 point);	 //¥¥Ω®∞¥≈•
	void initTipsWnd(string tipsBgName, string title = "", Color3B titleColor = Color3B(255, 255, 255), Color3B labelColor = Color3B(255, 255, 255)/*’˝Œƒ—’…´*/, float titleFSize=30, float labelFSize=20);	 //≥ı ºªØÃ· æøÚ
	void createTipsBgWithFile(string fileName);		  //¥¥Ω®Ã· æ±≥æ∞
	GNS_CursorTextField * createEditBox(std::string tips, Point pos, float FontSize, Color3B color, int limit, bool encryption = false/* «∑Òœ‘ æº”√‹*/);    //¥¥Ω®±‡º≠øÚ
	Label* createLabel(string str, Vec2 point, Color3B color = Color3B(255, 255, 255), float fontSize = 20);   //¥¥Ω®Œƒ±æ
	void initTitle(string str, Color3B color = Color3B(255, 255, 255), float fontsize = 20);	//œ‘ æ±ÍÃ‚
	void ShowLabel(string str = "", Color3B color = Color3B(255, 255, 255), float fontsize = 20, bool isShow = true);	 //œ‘ æ’˝Œƒ
	void ShowCommonTips(std::string tips, bool isShow);		 //œ‘ æÕ®”√Ã· æ
	Node * m_PopWndNode=nullptr;
    virtual void onExit();
private:
	Sprite* m_TipsBg = nullptr;     //±≥æ∞
	Button* m_CloseBtn = nullptr;    //πÿ±’ªÚ’ﬂ∑µªÿ∞¥≈•
	Button* m_SubmitBtn = nullptr;   //»∑∂®∞¥≈•
	Button* m_CancleBtn = nullptr;   //»°œ˚∞¥≈•
	EventListenerTouchOneByOne * listener;
	Label* m_Title = nullptr; //±ÍÃ‚
	Label* m_label = nullptr;  //Œƒ±æ

//	GNS_TipsWnd*  m_TipsLayer = nullptr;

	//º«¬ºÃ· æŒƒ◊÷
	std::string m_tips;
	Size m_WndViewSize;   //…Ë÷√µØ¥∞ø…º˚¥Û–°
};

#endif /* defined(__GameHall__GNS_YJFPopWnd__) */